﻿using CQIE.TES.IDAL;
using CQIE.TES.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CQIE.TES.DAL
{
    public class StudyYearDAL : DALBase<StudyYear>, IStudyYearDAL
    {
        /// <summary>
        /// 获取学年
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<StudyYear> GetStudyYearsInfo()
        {
            using (MyDB db = new MyDB()) {
                //取出表
                var query = (from st in db.StudyYear
                             select st).ToList();

                return query.Select(s => new StudyYear()
                {
                    ID = s.ID,
                    Name=s.Name
                    
                }).ToList();
            }
        }
    }
}
